<template>
  <div id="nav">
    <router-link to="/">主页</router-link> |
    <router-link to="/school/news">学校新闻</router-link> |
    <router-link to="/school/orgs">学校机构</router-link> |
    <router-link to="/about">关于</router-link> |
    <router-link :to="`/user/${userCode}`">用户</router-link> |
    <router-link :to="`/user/${userCode1}`">用户2</router-link> |
    <router-link to="/bpmnViewer">流程查看</router-link> |
    <router-link to="/bpmnModeler">流程设计</router-link> |
    <router-link to="/bpmnPropertyt">流程设计属性</router-link>
  </div>
  <router-view></router-view>
</template>

<script>
import { computed, reactive, toRefs } from 'vue'

export default {
  setup () {
    const data = reactive({
      userCode1: 'lb' + Math.floor(Math.random() * 10)
    })

    const userCode = computed(() => {
      return Math.floor(Math.random() * 10)
    })

    return {
      ...toRefs(data),
      userCode
    }
  }
}
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
